The present invention relates to the reading of data from optical media, and more particularly, to the realignment of the data stream when reading from the optical media.
In reading data from an optical media, a conventional optical drive controller, such as a Compact Disc (CD) or Digital Video,Disc (DVD) controller, receives a data stream from the optical media via a Read Channel Interface. The data""stream could be a 1-bit, 2-bit, 4-bit, or 8-bit data stream, depending on the media. For CD media, a data frame contains a standard 24-bit sync pattern followed by 564 data bits, with merging bits included. For DVD media, a data frame contains a standard 32-bit sync pattern followed by 1456 data bits. The controller""s sync processor scans for the sync pattern in the data frame to establish the frame boundary, using it as a reference mark to extract the data bits. Typically, the sync processor receives the data frame 1 bit at a time. Once the first two consecutive sets of sync patterns are found in two consecutive data frames, it will set this interval as the reference mark for subsequent sync marks, i.e., it will set the sync window. If the sync processor does not find a sync pattern at a later expected time, it will still maintain the same window.
When the data stream has minimal jittering or shifting, this conventional technique works reasonable well as the error correction scheme will correct the bit stream shift. Jittering, or shifting, refers to the erroneous dropping of bits from a data frame or the insertion of bits into the data frame due to noise in the data stream. The higher the bit speed of the optical drive, the higher the noise level. A problem arises that as the bit speed increases, there will be more shifting. This requires the controller to interrupt the data stream to realign the sync window by rereading the erroneous data frames, which requires time. This compromises the performance of the optical drive.
Accordingly, there exists a need for an improved method and system for window realignment to correct the data frame boundaries of data from an optical media. The present invention addresses such a need.
The present invention provides a method and system for window realignment to correct the data frame boundaries of data from an optical media. The present invention includes: determining if a sync pattern for a data frame is within a sync window; opening an extended sync window, if the sync pattern for the data frame is not within the sync window; determining if the sync pattern for the data frame is within the extended sync window; and realigning the sync window to the sync pattern in the extended sync window, if the sync pattern is within the extended sync window. The present invention utilizes an extended sync window to realign the sync window when the number of missing sync patterns in a data stream has exceeded a threshold number. In the preferred embodiment, the width of the extended sync window and the threshold number are programmable. In this manner, the sync window can be realigned before shifting of the data renders the data uncorrectable. This provides flexibility and avoids some data rereads, which improves the performance of optical drive. The present invention is also compatible with many different data formats.